package dahua_desgin;

import dahua_desgin.factory.OperationAddFactory;
import dahua_desgin.factory.OperationFactory;
import dahua_desgin.operation.Operation;

import java.util.Scanner;
/**
 * @ClassName: Client
 * @Description:  客户端  -  工厂方法模式
 * @Version: v1.0.0
 * @Author: tamir
 * @Date: 2022/05/26
 * Modification History:
 * Date             Author      Version     Description
 * -------------------------------------------------------------
 * 2022/05/26      tamir        v1.0.0      创建
 */
public class Client {
	public static void main(String[] args) {
		System.out.println("输入第一个值：");
		Scanner inp = new Scanner(System.in);
		Integer num1 = inp.nextInt();
		System.out.println("输入字符串：");
		Scanner inp2 = new Scanner(System.in);
		String op = inp2.nextLine();
		System.out.println("输入第二个数：");
		Scanner inp3 = new Scanner(System.in);
		Integer num2 = inp3.nextInt();
		
		OperationFactory opf = new OperationAddFactory();
		Operation operation = opf.createOperation();
		operation.num1 = num1;
		operation.num2=num2;
		System.out.println(operation.getResult());
	}
}
